<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
<body>
    <ui:composition template="/WEB-INF/template.xhtml">
        <ui:define name="topnav">
            <ui:include src="/WEB-INF/incl/cust_nav.xhtml">
                <ui:param name="page" value="browse"/>
            </ui:include>
        </ui:define>

        <ui:define name="sidebar">
            <ui:include src="/WEB-INF/incl/login.xhtml" />
        </ui:define>

        <ui:define name="body">
            <h2>#{msgs.checkoutCompleteHeader}</h2>
            <h:form>
                <h:dataTable value="#{order.orderLines}" 
                             var="item"
                             styleClass="dvdtable" 
                             headerClass="dvdtablehead"
                             rowClasses="dvdtableodd,dvdtableeven"
                             columnClasses="dvdtablecol">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{msgs.cartItemColumn}" />
                        </f:facet>
                        <h:outputText value="#{item.position}" />
                    </h:column>                        
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{msgs.cartQuantityColumn}" />
                        </f:facet>
                        <h:outputText value="#{item.quantity}" />
                    </h:column>                        
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{msgs.cartTitleColumn}" />
                        </f:facet>
                        <h:outputText value="#{item.product.title}" />
                    </h:column>                        
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{msgs.cartActorColumn}" />
                        </f:facet>
                        <h:outputText value="#{item.product.actor}" />
                    </h:column>                        
                    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{msgs.cartPriceColumn}" />
                        </f:facet>
                        <h:outputText value="#{item.product.price}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                    </h:column>                        
                </h:dataTable>
            </h:form>


            <div style="width: 100%;">
                <div class="cntInfo" style="float: right;">
                    <h:panelGrid columns="2">
                        <h:outputText value="#{msgs.checkoutSubtotal}" />
                        <h:outputText value="#{order.netAmount}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                        
                        <h:outputText value="#{msgs.checkoutTax}" />
                        <h:outputText value="#{order.tax}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                        
                        <h:outputText value="#{msgs.checkoutTotal}" />
                        <h:outputText value="#{order.totalAmount}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                    </h:panelGrid>
                </div>

                <div style="float:clear">&nbsp;</div>
            </div>
            

            <p class="orderBox cntAlert">
                Thank you for ordering. 
                <h:outputText value="#{order.totalAmount}"> 
                    <f:convertNumber type="currency" currencySymbol="$" />
                </h:outputText>
                charged was to your <h:outputText value="#{order.customer.creditCardTypeString}" />.
                Your order number is 
                <h:outputText value="#{order.orderId}" />.
            </p>
        </ui:define>
    </ui:composition>
</body>
</html>
